﻿namespace Cellfish.Test.Fakes.System
{
    using global::System;
    using global::System.Threading;

    /// <summary>
    /// Implements a fake IAsyncResult for test purposes.
    /// </summary>
    public class FakeAsyncResult : IAsyncResult
    {
        /// <summary>
        /// Gets or sets a value that indicates whether the asynchronous operation has completed.
        /// </summary>
        /// <returns>true if the operation is complete; otherwise, false.</returns>
        public bool IsCompleted { get; set; }

        /// <summary>
        /// Gets or sets a <see cref="T:System.Threading.WaitHandle" /> that is used to wait for an asynchronous operation to complete.
        /// </summary>
        /// <returns>A <see cref="T:System.Threading.WaitHandle" /> that is used to wait for an asynchronous operation to complete.</returns>
        public WaitHandle AsyncWaitHandle { get; set; }

        /// <summary>
        /// Gets or sets a user-defined object that qualifies or contains information about an asynchronous operation.
        /// </summary>
        /// <returns>A user-defined object that qualifies or contains information about an asynchronous operation.</returns>
        public object AsyncState { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether the asynchronous operation completed synchronously.
        /// </summary>
        /// <returns>true if the asynchronous operation completed synchronously; otherwise, false.</returns>
        public bool CompletedSynchronously { get; set; }
    }
}
